home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / arraydeleteat.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  731 b   |  27 lines

  1. <!--- This example shows ArrayDeleteAt --->
  2. <HTML>
  3. <HEAD>
  4. <TITLE>ArrayDeleteAt Example</TITLE>
  5. </HEAD>
  6.  
  7. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  8. <BODY  bgcolor="#FFFFD5">
  9.  
  10. <H3>ArrayDeleteAt Example</H3>
  11.  
  12. <P>
  13. <!--- create a new array --->
  14. <CFSET DaysArray = ArrayNew(1)>
  15. <!--- populate an element or two --->
  16. <CFSET DaysArray[1] = "Monday">
  17. <CFSET DaysArray[2] = "Tuesday">
  18. <CFSET DaysArray[3] = "Wednesday">
  19. <!--- delete the second element --->
  20. <P>Is the second element gone?: <CFOUTPUT>#ArrayDeleteAt(DaysArray,2)#</CFOUTPUT>
  21. <!--- note that the formerly third element, "Wednesday"
  22. is now the second element --->
  23. <P>The second element is now: <CFOUTPUT>#DaysArray[2]#</CFOUTPUT>
  24.  
  25. </BODY>
  26. </HTML>       
  27.